import React, { Fragment } from "react"
import "./css/animateTest.css"

class AnimateTest extends React.Component {
  state = {
    show: true
  }

  handleToggle = () => {
    this.setState(state => ({
      show: !state.show
    }))
  }

  render() {
    return (
      <Fragment>
        <h1 className={this.state.show ? "show" : "hide"}>通过改变 className 来实现动画</h1>
        <button onClick={this.handleToggle}>
          点击切换动画效果
        </button>
      </Fragment>
    )
  }
}

export default AnimateTest
